/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.modeler.editparts;

import java.beans.PropertyChangeEvent;

import org.eclipse.swt.graphics.Image;

import edu.pku.sei.modeler.icons.ModelerUIIcons;
import edu.pku.sei.modeler.model.core.MetaEnum;
import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.structure.MetaShapeElement;

/**
 * @author zl
 *
 */
public class MetaEnumTreeEditPart extends MetaNamedElementTreeEditPart {
	public MetaEnumTreeEditPart(MetaShapeElement model) {
		super(model);
	}
	
	protected void handlePropertyChanged(PropertyChangeEvent event) {
    	super.handlePropertyChanged(event);
	}
	
    private MetaEnum getMetaEnum() {
		return (MetaEnum)((MetaNode)getModel()).getModelElement();
	}
    
    protected void refreshVisuals() {
    	super.refreshVisuals();
    	Image image = ModelerUIIcons.getImage(ModelerUIIcons.ENUM);
    	setWidgetImage(image);
        setWidgetText(getMetaEnum().getName());
    }
}
